import Index from './components/index/index';

/**
 * needLogin {Boolean} 是否是表示登陆
 * false 当前路由链接不需要登录.
 * true 需要登陆
 */

export default {
//      '/': {
//          component: Index
//      },
    //商品详情
    '/details/:spuCode': {
        name: 'spucode',
//          needLogin:false,
        component: function ( resolve ) {
            require(['./components/details/index'], resolve)
        }
    },
    //选择优惠券
    '/choosecoupon': {
        needLogin: false,
        component: function ( resolve ) {
            require(['./components/choose-coupon/index'], resolve)
        }
    },
    //服务确认订单
    '/orderservice':{
        name:"confirm-order-service",
        needLogin: true,
        component:function(resolve){
            require(['./components/confirm-order/index-service'],resolve)
        },
        subRoutes: {
            '/ordercarplate': {
                title:"选择车牌",
                component:function(resolve){
                    require(['./components/confirm-order/confirm-order-carplate'],resolve)
                }
            },
            '/orderchoosecoupon':{
                title:"选择优惠券",
                component:function(resolve){
                    require(['./components/confirm-order/confirm-order-choosecoupon'],resolve)
                }
            }
        }
    },
    //轮胎确认订单
    '/ordertyre':{
        name:"confirm-order-tyre",
        // needLogin: false,
        component:function(resolve){
            require(['./components/confirm-order/index-tyre'],resolve)
        },
        subRoutes: {
            '/ordercarplate': {
                title:"选择车牌",
                component:function(resolve){
                    require(['./components/confirm-order/confirm-order-carplate'],resolve)
                }
            },
            '/orderchoosecoupon':{
                title:"选择优惠券",
                component:function(resolve){
                    require(['./components/confirm-order/confirm-order-choosecoupon'],resolve)
                }
            }
        }

    },
    //确认订单选择优惠券
    '/orderchoosecoupon':{
        name:"confirm-order-choosecoupon",
        // needLogin: false,
        component:function(resolve){
            require(['./components/confirm-order/confirm-order-choosecoupon'],resolve)
        }
    },
    //确认订单选择车牌
    '/ordercarplate':{
        name:'confirm-order-carplate',
        // needLogin: false,
        component:function(resolve){
            require(['./components/confirm-order/confirm-order-carplate'],resolve)
        }
    },
    // 套餐卡-服务选择
    '/cardservicechoose/:cardCode/:cardTemplateNo':{
        name:'cardselect',
        needLogin: false,
        component:function(resolve){
            require(['./components/card-service-choose/index'],resolve)
        }
    },
    //套餐卡-订单提交
    '/cardconfirmorder/:cardTemplateNo':{
        name:'cardconfirmorder',
        needLogin: false,
        component:function(resolve){
            require(['./components/card-confirm-order/index'],resolve)
        }
    },
    // 套餐卡-支付成功
    '/cardpaysuccess':{
        name: 'cardpaysuccess',
        needLogin: false,
        component:function(resolve){
            require(['./components/card-pay-success/index'],resolve)
        }
    },
    // 成功页面
    '/success':{
        name: 'success',
        needLogin: false,
        component:function(resolve){
            require(['./components/success/index'],resolve)
        }
    },


    // 套餐卡-我的套餐卡
    '/mycard':{
        name: 'mycard',
        needLogin: true,
        component:function(resolve){
            require(['./components/my-card/index'],resolve)
        }
    },
    // 套餐卡-我的不可用套餐卡
    '/denycard/:type':{
        name:'denycard',
        needLogin: false,
        component:function(resolve){
            require(['./components/my-card/deny-card'],resolve)
        }
    },
    //套餐卡-购买列表
    '/cardlist':{
        needLogin: false,
        component:function(resolve){
            require(['./components/card-list/index'],resolve)
        }
    },

    // 套餐卡- 卡详情
    '/mycarddetails/:cardCode':{
        name:'mycarddetails',
        needLogin: false,
        component:function(resolve){
            require(['./components/card-details/index'],resolve)
        }
    },
    // 套餐卡- 添加套餐卡弹出框
//      '/card-add':{
//              component:function(resolve){
//                      require(['./components/card-add/index'],resolve)
//              }
//      },
    // 套餐卡-购买套餐卡
    '/cardbuy/:spuCode':{
        name:'cardbuy',
        needLogin: false,
        component:function(resolve){
            require(['./components/card-buy/index'],resolve)
        }
    },
    // 套餐卡- 订单提交（购买套餐卡提交页面）
    '/cardsalesubmit':{
        needLogin: false,
        component:function(resolve){
            require(['./components/card-sale-submit/index'],resolve)
        }
    },
    // 套餐卡- 城市选择
    '/citylist':{
        needLogin: false,
        component:function(resolve){
            require(['./components/city-list/city-list'],resolve)
        }
    },
    //套餐卡-使用说明
    '/useexplain':{
        needLogin: false,
        component:function(resolve){
            require(['./components/use-explain/index'],resolve)
        }
    },
    // 套餐卡-订单提交
    '/cardservice':{
        name:"card-service",
        needLogin: false,
        component:function(resolve){
            require(['./components/confirm-order/card-service'],resolve)
        }
    },
    //提交成功页面

    '/success':{
        name:"success",
        needLogin: false,
        component:function(resolve){
            require(['./components/success/index'],resolve)
        }
    },
    // 404
    '*': {
        name: 'notfile',
        component: function ( resolve ) {
            needLogin: false,
                require(['./components/notFile'], resolve)
        }
    },
    'notfile': {
        name: 'notfile',
        component: function ( resolve ) {
            needLogin: false,
                require(['./components/notFile'], resolve)
        }
    }

    // //发现图文详情
    // '/imgdetails': {
    //     name:"imgdetails",
    //     needLogin: false,
    //     component: function( resolve ) {
    //         require(['./components/discover/img-details'], resolve)
    //     }
    // },
    // //发现视频详情
    // '/videodetails': {
    //     name:"videodetails",
    //     needLogin: false,
    //     component: function( resolve ) {
    //         require(['./components/discover/video-details'], resolve)
    //     }
    // },




    // '/discover/:cityid':{
    //     name:"discover",
    //     needLogin: false,
    //     component:function(resolve){
    //         require(['./components/discover/index'],resolve)
    //     }
    // },
    // '/discoverlist':{
    //     name:"discoverlist",
    //     component:function(resolve){
    //         require(['./components/discover/list'],resolve)
    //     }
    // },


    /**
     * ------------------------------------------------------------
     * APP 4.0
     * ------------------------------------------------------------
     */
    // 红包详情
    // 'redp': {
    //     component: function(resolve) {
    //         require(['./components/red-packet'], resolve);
    //     }
    // },
    // 'newsucc': {
    //     component: function(resolve) {
    //         require(['./components/newsucc'], resolve);
    //     }
    // }

}